const mysql = require('mysql');

var con = mysql.createConnection({
    host:"localhost",
    port:3306,
    user:"root",
    password:"dwx123.",
    database:"dwx"
})

var userName = process.argv[2];
var selectSql = "select userName,age from user where userName=?";
con.query(selectSql,[userName],(err,result)=>{
    if(err){
        console.log(err);
    }else{
        var userList = result;
        for(var i=0;i<userList.length;i++){
            console.log(userList[i]["age"]);
        }
    }
})